<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/cloudiary.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Cloudiary</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<script type="text/javascript" src="Js/jquery.js"></script>
<script type="text/javascript" src="Js/slider.js"></script>
<!-- InstanceEndEditable -->
<link href="CSS/css.css" rel="stylesheet" type="text/css" />
</head>

<?php
include('userlock.php');

if($_SERVER["REQUEST_METHOD"] == "POST")
{
	$sql="SELECT user_password FROM user where user_email = '$login_session'";
	$query=mysql_query($sql);
	$row=mysql_fetch_array($query);
	if($_POST['currentPass'] && $_POST['newPass'] && $_POST['confirmPass'])
	{
		if($row['user_password'] == $_POST['currentPass'])
		{
			if($_POST['newPass'] == $_POST['confirmPass'])
			{						
				$mynew=addslashes($_POST['newPass']);
				$sql="UPDATE user SET user_password='$mynew' WHERE user_email='$login_session'";
				mysql_query($sql);
				header('Location: Particulars.php');
			}
		}
	}
}

?>
<body>
<div id="container">
<div id="wrapper">

<div id="header">
<!-- InstanceBeginEditable name="header" -->
<div class="welcome">
<?php include('welcomeuser.php'); ?>
</div>
<!-- InstanceEndEditable -->

<img src="Assets/cloud diary low-01(trans).png" alt="CloudDiary" width="75" height="45" style="padding:5px 10px;" /> <br />
</div>

<div id="main">
<!-- InstanceBeginEditable name="main" -->
<ul class="dropdown">
<li><a href="Home.php" class="linkStraight">Home &nbsp; &nbsp;</a></li>
<li><a href="#" class="linkDown" id="classification">Classifications &nbsp; &nbsp;</a>
	<ul class="sub_menu" id="menu1">
    <li> <a href="PublicClassification.php"> Public &nbsp; </a> </li>
    <li> <a href="FriendClassification.php"> Friend &nbsp; </a> </li>
    </ul>
</li>
<li><a href="#" class="linkDown" id="friends">Friends &nbsp; &nbsp;</a>
	<ul class="sub_menu" id="menu2">
    <li> <a href="Friends.php"> Search Friends &nbsp; </a> </li>
    <li> <a href="CurrentFriends.php"> Current Friends &nbsp; </a> </li>
    <li> <a href="Send.php"> Sending Request &nbsp; </a> </li>
    <li> <a href="Receive.php"> Pending Request &nbsp; </a> </li>
    </ul>
</li>
<li><a href="#" class="linkDown" id="posts">Posts &nbsp; &nbsp;</a>
	<ul class="sub_menu" id="menu3">
    <li> <a href="NewPost.php"> New Post &nbsp; </a> </li>
    <li> <a href="ViewPosts.php">  View All Posts &nbsp; </a> </li>
    </ul>
</li>
<li><a href="Privacy.php" class="linkStraight">Privacy Settings &nbsp; &nbsp;</a></li>
</ul>

<div id="content">
<p align="center"> <b> CHANGE PASSWORD </b> </p>
    
    <form name="passwordChange" id="form" method="POST">
    <label> <span> Current Password </span>
    <input type="password" name="currentPass" autofocus class="blank" /> </label>
    
    <label> <span> New password </span>
    <input type="password" name="newPass" class="blank" /> </label>
    
    <label> <span> Password Confirmation </span>
    <input type="password" name="confirmPass" class="blank" /> </label>
    
    <label> <span> </span> <input type="image" src="Assets/buttonSubmit.png" value="Submit" style="padding-left:10px" />  </label>

    </form>
</div>
<!-- InstanceEndEditable -->
</div>

</div>
</div>

<div id="footer">
<p align="center"> &copy; &nbsp; 2012 CloudDiary </p>
</div>
</body>
<!-- InstanceEnd --></html>